package ca.psquared.superbrixgame.key;

public class KeyAction implements IKeyAction {
    private final int expectedKey;

    public KeyAction(int key){
        this.expectedKey = key;
    }
    @Override
    public final void keyPressed(int key) {
        if (key == expectedKey) {
            onKeyPressed();
        }
    }

    @Override
    public final void keyReleased(int key) {
        if (key == expectedKey) {
            onKeyReleased();
        }
    }

    protected void onKeyReleased() {
    }

    protected void onKeyPressed() {
    }
}
